﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectUserGridForm.aspx.cs"
    Inherits="FX.CC.Andon.WebSite.CommForm.SelectUserGridForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>人员信息</title>
    <script src="../lib/boot.js" type="text/javascript"></script>
</head>
<body>
    <div class="mini-toolbar" style="padding: 2px;" borderstyle="border:0;">
        <table style="width: 100%;">
            <tr>
                <td style="width: 100%;">
                    登录账号：<input id="LoginCode" class="mini-textbox" emptytext="请输入账号" style="width: 150px;"
                        onenter="onKeyEnter" />
                    姓名：<input id="FullName" class="mini-textbox" emptytext="请输入姓名" style="width: 150px;"
                        onenter="onKeyEnter" />
                    <a class="mini-button" iconcls="icon-search" onclick="search()">查 询</a>
                </td>
            </tr>
            <tr>
                <td style="width: 100%;">
                    手机号码：<input id="MobileNo" class="mini-textbox" emptytext="请输入手机号码" style="width: 150px;"
                        onenter="onKeyEnter" />
                    部门：<input id="Dept" class="mini-combobox" style="width: 150px;" textfield="DptName"
                        valuefield="DptID" url="../service/PublicHandler.ashx?action=GetDeptList" shownullitem="true"
                        allowinput="false" />
                    <a class="mini-button" iconcls="icon-reset" onclick="reset()">重 置</a>
                </td>
            </tr>
        </table>
    </div>
    <!--撑满页面-->
    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width: 100%; height: 100%;" idfield="UserID"
            sizelist="[10,20,50,100]" pagesize="10" onrowdblclick="ondoubleclick()" borderstyle="border-left:0;border-right:0;"
            multiselect="true">
            <div property="columns">
                <div type="checkcolumn">
                </div>
                <div field="LoginCode" width="120" headeralign="center" allowsort="false">
                    登录账号
                </div>
                <div field="FullName" width="140" headeralign="center" allowsort="false">
                    姓名
                </div>
                <div field="MobileNo" width="120" headeralign="center" allowsort="false">
                    手机号码
                </div>
                <div field="DptName" width="100" headeralign="center" allowsort="false">
                    部门
                </div>
            </div>
        </div>
    </div>
    <div class="mini-toolbar" style="text-align: center; padding-top: 8px; padding-bottom: 8px;"
        borderstyle="border:0;">
        <a class="mini-button" iconcls="icon-ok" style="width: 60px;" onclick="onOk()">确定</a>
        <span style="display: inline-block; width: 25px;"></span><a class="mini-button" iconcls="icon-cancel"
            style="width: 60px;" onclick="onCancel()">取消</a>
    </div>
    <script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        grid.setUrl("../service/SystemManageHandler.ashx?action=GetIsOperatorUserList&RecStatus=1");
        grid.load();
        function search() {
            var loginCode = mini.get("LoginCode").getValue();
            var fullName = mini.get("FullName").getValue();
            var MobileNo = mini.get("MobileNo").getValue();
            var dptId = mini.get("Dept").getValue();
            grid.load({ LoginCode: loginCode, FullName: fullName, MobileNo: MobileNo, DptID: dptId });
        }
        //回车键事件
        function onKeyEnter() {
            search();
        }

        function GetData() {
            var rows = grid.getSelecteds();
            var data = [];
            for (var i = 0, l = rows.length; i < l; i++) {
                var row = rows[i];
                data.push(row);
            }
            return data;
        }
        function ondoubleclick() {
            onOk();
        }

        function onOk() {
            var rows = grid.getSelecteds();
            if (rows) {
                CloseWindow("ok");
            }
            else {
                mini.alert("请选中一条您需要添加的记录!");
            }

        }
        function reset() {
            mini.get("LoginCode").setValue("");
            mini.get("FullName").setValue("");
            mini.get("MobileNo").setValue("");
            mini.get("Dept").setValue("");

        }
        function CloseWindow(action) {
            if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
            else window.close();
        }
        function onCancel() {
            CloseWindow("close");
        }
    </script>
</body>
</html>
